/*
 * e-motion control http://code.google.com/p/e-motioncontrol/
 * 
 * Copyright (c) 2008-2009,
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms,
 * with or without modification, are permitted provided
 * that the following conditions are met:
 *    - Redistributions of source code must retain the
 *      above copyright notice, this list of conditions
 *      and the following disclaimer.
 *    - Redistributions in binary form must reproduce the
 *      above copyright notice, this list of conditions and
 *	the following disclaimer in the documentation and/or
 *	other materials provided with the distribution.
 *    - Neither the name of the e-motioncontrol nor the names
 *      of its contributors may be used to endorse or promote
 *	products derived from this software without specific
 *	prior written permission.
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
 * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICTLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef EMC_TYPES
#define EMC_TYPES

#include <gtk/gtk.h>
#include "wiimote.h"

#define MODE_ACQUIRE 1
#define MODE_UPDATE 0

/** Structure used to store all informations about the mouse
 * @struct mouse_t
 */
typedef struct mouse_t
{
  int fd;  /**< File descriptor for the mouse */
  int click_inprogress;
  int click;
  int clicking;
  int dx;
  int dy;
  float time;
  time_t last_tick;
} mouse_t;

typedef struct s_gesture *t_gesture;

struct s_gesture {
	int id;
	char *name;
	t_gesture next;
};

/** Structure used to store all informations about the application
 * @struct s_data
 */
typedef struct s_data {
	int mode;
	int cfg_opened;
	int acq_opened;
	int key_mode;
	int ready;
	struct wiimote_t* wm;      /**< Wiimote's structure */
	mouse_t *mouse;   /**< Mouse informations */
	GtkWidget *main_window;
	GtkWidget *drawindow;
	GtkWidget *about;
	GtkWidget *coordwindow;
	GtkWidget *acquirewindow;
	GtkWidget *name;
	GtkLabel  *coordinfos;
	GtkWidget *drawArea;
	GtkWidget *green_button;
	GtkWidget *red_button;
	GdkPixmap *pixmap;
	GtkWidget *config;
	int nb_gestures;
	t_gesture gestures;	
} *t_data;

#endif
